ChatManager = {
    id: null,
    timeout: 1500,
    init: function(id){
        this.id = id;
        
    },
    send: null,
    setStatus: null,
    refresh: null,
    
    updateStatus: function(){
        //TODO
    },
    close: function (){
        this._sendEmptyRequest('close', this.updateStatus);
    },
    //private functions
    _sendEmptyRequest: function(url, callback){
        $.ajax({
            url: url,
            type: "POST",
            success: function() {
                callback();
            }
        });
    },
    _formatDate: function (date){
        var dd = date.getDate();
        var MM = date.getMonth();
        var yyyy = date.getFullYear();

        var hh = date.getHours();
        var mm = date.getMinutes();
        var ss = date.getSeconds();
                
        return hh+":"+mm+":"+ss+" "+dd+"."+MM+"."+yyyy;
    }
}